package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;

/**评论实体类*/
public class SpeakBean {
    private int id;
    private UserBean user;
    private BookBean book;
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate date = LocalDate.now();

    public SpeakBean() {
    }

    public SpeakBean(int userId, int bookId, String content) {
        this.user = new UserBean();
        this.user.setId(userId);

       this.book = new BookBean();
       this.book.setId(bookId);

       this.content = content;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public BookBean getBook() {
        return book;
    }

    public void setBook(BookBean book) {
        this.book = book;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "SpeakBean{" +
                "id=" + id +
                ", user=" + user +
                ", book=" + book +
                ", content='" + content + '\'' +
                ", date=" + date +
                "}\n";
    }
}
